package com.sigmatrix.h5.web.controller.utils;

import java.math.BigDecimal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sigmatrix.h5.service.db.DisRebateDetailDBService;
import com.sigmatrix.h5.web.BaseController;

/**
 * 返利相关。测试mybatic常用操作
 * 
 * @author wei.wang
 *
 */
@RestController
@RequestMapping("/util/test/rebate")
public class TestRebateDetailController extends BaseController {

	@Autowired
	private DisRebateDetailDBService disRebateDetailDBService;
	

	//ok
	@GetMapping("/stat/amount/eseCode/{eseCode}/dealerId/{dealerId}/dealerType/{dealerType}")
	public BigDecimal statAmountsByDealerIdAndType(@PathVariable String eseCode,@PathVariable Integer dealerId,@PathVariable Integer dealerType) {
		BigDecimal amounts = disRebateDetailDBService.statAmountsByDealerIdAndType("_"+eseCode, dealerId, dealerType);
		System.err.println("amounts: "+amounts);
		return amounts;
	}
	
}
